import requests
from lxml import etree, html

url = "https://kyfw.12306.cn/otn/leftTicket/query?leftTicketDTO.train_date=2024-05-17&leftTicketDTO.from_station=ZZF&leftTicketDTO.to_station=BJP&purpose_codes=ADULT"
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
    "Referer": 'https://kyfw.12306.cn/otn/leftTicket/init?linktypeid=dc',
    'Cookie': '_uab_collina=171590831049186790821214; JSESSIONID=3B4DCD9256A6AC24C1DB5E730CEAD5E5; BIGipServerpassport=887619850.50215.0000; guidesStatus=off; highContrastMode=defaltMode; cursorStatus=off; route=c5c62a339e7744272a54643b3be5bf64; BIGipServerotn=1557725450.50210.0000; _jc_save_fromStation=%u90D1%u5DDE%2CZZF; _jc_save_toStation=%u5317%u4EAC%2CBJP; _jc_save_fromDate=2024-05-17; _jc_save_toDate=2024-05-17; _jc_save_wfdc_flag=dc'
}
res = requests.get(url, headers=headers)
res = res.content.decode('utf8')
print(res)
